<%@ page language="java" import="java.util.*" import="com.rw.table.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>RW_b2c-address</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	

	<style  type="text/css">
			@import "./css/shop/header.css";
			@import "./css/shop/item.css";
	</style>
	

	<script language="javascript" type="text/javascript" src="javascript/MulitiEffect.js">
	</script>
    <script type="text/javascript">
    	function add() {
     		alert("添加");
     		document.forms("add").submit();
   		 }
	</script>
  </head>
  
  <body>
  <% Item itemInfo = (Item)request.getAttribute("favoriteItemInfo");
     long itemId = (Long)request.getAttribute("favoriteItemId");
     List<Comment> comments = (List<Comment>)request.getAttribute("comment");
  %>
     <jsp:include flush="true" page="header.jsp"></jsp:include>
     <form method="post" id="add" action="addFavorite">
     <input type="hidden" name="favoriteItemId" value="<%=itemId %>"/>
     </form>    
     <div class="introFrame">
			<div class="imageFrame">
				<img src="images/item/dxwl4.jpg"/>
			</div>
			
			<div class="introTextFrame">
			    <h2><%=itemInfo.getItemName() %></h2>				<!--需要接受页面传值。商品名 -->
				<p>仅售33元还包邮！还不快买。。夏天各种曼妙有活力还有一点小性感？ 这就是传说中的大学物理么？
				</p>
				<p>用户评分：<!--☆ ★ 评分就在这里copy吧，不用贴图了。-->
						<%for (int i=0;i<5;i++)
						{ 
									out.print("☆");			
						}												
						%>
				</p>
				<p>	库存量:<%=itemInfo.getItemReserveNum() %></p>				
			</div>
					
			<div class="priceFrame">
				<div class="priceTextFrame">
					<p>市场价：<%=itemInfo.getItemMarketPrice() %>元</p>
					<p>节 &nbsp 约：18元</p>
				</div>
				<div class="memberPriceFrame">
					<img src="images/src/bg/member-price.gif"/>
				</div>
				<div class="memberPrice">
					<p>¥25</p>
				</div>				
			</div>
			
			<div class="button">
				<input type="image" src="images/src/button/add-cart.gif" onClick="add()"/>
				<input type="image" src="images/src/button/add-favor.gif" />
			</div>				
	 </div>
	 
	 <div class="comment">
		<h1>该商品共有几条评论?</h1>
		<hr/>
		<p/>
		<table  class="commentTable" cellpadding="5">
		<%Iterator<Comment> iterator = comments.iterator();
			   while(iterator.hasNext()){
				   Comment comment = iterator.next();
				   %>
			<tr>
				<td>会员: <%=comment.getCommentUserId() %></td>
				<td class="commentator">aaa@163.com</td>
				<td>发表时间:</td>
				<td class="commentator"> <%=comment.getCommentTime() %></td>
				<td >打分<%=comment.getCommentScore() %></td>
				<td class="commentator"> 
					<%for (int i=0;i<comment.getCommentScore();i++)
						{ 
							out.print("☆");			
						}												
					%>
				</td>
			</tr>
			<tr>
				<td class="commentContentPredix">评论：<%=comment.getCommentDetail() %></td>
				<td colspan="5" class="commentContent">
				大学物理4，您的必修课，买吧。<%=comment.getCommentDetail() %>
				</td>
			</tr>
			<%
			   }
			%>
						<tr>
				<td>会员: </td>
				<td class="commentator">aaa@163.com</td>
				<td>发表时间:</td>
				<td class="commentator"> 2012-2-2</td>
				<td >打分</td>
				<td class="commentator"> 
					<%for (int i=0;i<5;i++)
						{ 
							out.print("☆");			
						}												
					%>
				</td>
			</tr>
			<tr>
				<td class="commentContentPredix">评论：</td>
				<td colspan="5" class="commentContent">
				大学物理4，您的必修课，买吧。
				</td>
			</tr>
						<tr>
				<td>会员: </td>
				<td class="commentator">aaa@163.com</td>
				<td>发表时间:</td>
				<td class="commentator"> 2012-2-2</td>
				<td >打分</td>
				<td class="commentator"> 
					<%for (int i=0;i<5;i++)
						{ 
							out.print("☆");			
						}												
					%>
				</td>
			</tr>
			<tr>
				<td class="commentContentPredix">评论：</td>
				<td colspan="5" class="commentContent">
				大学物理4，您的必修课，买吧。
				</td>
			</tr>
						<tr>
				<td>会员: </td>
				<td class="commentator">aaa@163.com</td>
				<td>发表时间:</td>
				<td class="commentator"> 2012-2-2</td>
				<td >打分</td>
				<td class="commentator"> 
					<%for (int i=0;i<5;i++)
						{ 
							out.print("☆");			
						}												
					%>
				</td>
			</tr>
			<tr>
				<td class="commentContentPredix">评论：</td>
				<td colspan="5" class="commentContent">
				大学物理4，您的必修课，买吧。
				</td>
			</tr>
		</table>	
	 </div>
	 
	 <div class="commentInputFrame">
		<table class="input" border="0" cellpadding="1">
			<tr>
				<td>打分：</td>
				<td align="center"><input type="radio"  name="onestar"/> ☆很不喜欢</td>
				<td><input type="radio"  name="onestar"/> ☆☆不喜欢</td>
				<td><input type="radio"  name="onestar"/> ☆☆☆一般</td>
				<td><input type="radio"  name="onestar"/> ☆☆☆☆喜欢</td>
				<td><input type="radio"  name="onestar"/> ☆☆☆☆☆很喜欢</td>
			</tr>
			<tr>
				<td>评论：</td>
				<td colspan="5">
					<textarea cols="30" rows="5">
					</textarea>
				</td>			
			</tr>
			<tr>
				<td></td>
				<td>					
					<input type="image"  src="images/src/button/add.png"/>
					<input type="image" src="images/src/button/reset.png"/>
				</td>
			</tr>
		</table>
	 </div>
     
     
     <jsp:include page="footer.jsp" flush="true"></jsp:include>
  </body>
</html>
